frmWs_Encrypt.Text1(3) = "Getting Error " & Err.Number & ":" & Err.Description 'You might want to take this out for your program.
End Function
Public Function WS_Encrypt(PlainText)
On Error GoTo ErrorH
Dim iSalt(32) As Integer
Dim sSalt(32) As String
Dim sLetterHex(32) As String
frmWs_Encrypt.Text1(3) = ""
Randomize Timer
For I = 1 To 32 'Generate 32 salt values in hex and int. More then you will usually need.
iRand = Int(Rnd * 16)
sHex = Hex(iRand)
iSalt(I) = iRand
sSalt(I) = sHex
Next I
For I = 1 To Len(PlainText) 'This loop is the cipher that encrypts each letter of plaintext into ciphertext using the random salt value and letter position.
iLetter = Asc(Mid(PlainText, I, 1))
SaltPlus = iSalt(I) + 47
SaltPlus = SaltPlus Mod 57
iLetter = iLetter + SaltPlus
iLetter = iLetter + I
sLetterHex(I) = Hex(iLetter)
Next I
sEncrypted = "V" 'V is always the first character. Probably has to do with the name of the cypher.